const login = require("./login");
const test = require("./test");

const api = (app) => {
  for (const key in login) {
    const { methods, handle } = login[key];
    app[methods]("/" + key, (req, res) => {
      handle(req, res);
    });
  }
  for (const key in test) {
    const { methods, handle } = test[key];
    app[methods]("/" + key, (req, res) => {
      handle(req, res);
    });
  }
};

module.exports.api = api;
